package omm.domain.comparativegraph;

import java.util.AbstractMap;
import java.util.Map.Entry;

import omm.domain.Quotation;
import omm.domain.Risk;

public class ProductStrategy implements GroupStrategy {

	@Override
	public Entry<String, Double> makeEntry(Quotation quotation) {
		
		Risk risk = quotation.getRisk();
		if (risk == null)
			return null;
		
		String descMin = risk.getDescMin();
		Double aonCommision = quotation.getAonCommision();

		if ((descMin == null) || (aonCommision == null))
			return null;
		
		Entry<String, Double> entry = new AbstractMap.SimpleEntry<String, Double>(descMin, aonCommision);
		return entry;
	}

}
